/*
 ============================================================================
 Name		: CPanicSession.h
 Author	  : wangli@opi-corp.com
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CCPanicSession declaration
 ============================================================================
 */

#ifndef CPANICSESSION_H
#define CPANICSESSION_H

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include <f32file.h>

#include "RCallStack.h"

// CLASS DECLARATION

/**
 *  CCPanicSession
 * 
 */
class CPanicSession: public CSession2
{
public:
    ~CPanicSession();
    static CPanicSession* NewL(const RMessage2& aMessage);
    static CPanicSession* NewLC(const RMessage2& aMessage);
 
    virtual void ServiceL(const RMessage2& aMessage);

private:
    void DispatchMessageL(const RMessage2& aMessage);
    void CreateCallStack(const RMessage2& aMessage);
    void ClientLeaveService(const RMessage2& aMessage);
    void CloseSession(const RMessage2& aMessage);
    
    CPanicSession();
    void ConstructL(const RMessage2& aMessage);  
    TInt MakeRecord(const TDesC8& aInfo);

private:
    RCallStack iStack;
    RFs iFs;
    RFile iDumpFile;
    TBool iClosed;
    RThread iClientThread;
};

#endif // CPANICSESSION_H
